# Stage 1: Build Vue.js app
FROM node:14-alpine
# Create app directory & set default dir so that next commands executes in /usr/app dir, liked cd-ing into /usr/app to execute npm install
# RUN apk update && apk add python3 && apk add make
# ENV PYTHON=/usr/bin/python3

WORKDIR /app
COPY .npmrc ./
COPY package*.json ./
RUN npm install

COPY . .
# RUN npm install
RUN npm run build:test

# Stage 2: Serve Vue.js app with Nginx
FROM nginx:alpine
COPY --from=0 /app/dist /usr/share/nginx/html
EXPOSE 9528
CMD ["nginx", "-g", "daemon off;"]